import { IsArray, IsBoolean, IsEnum, IsInt, IsString } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';
import { TaskStatus } from 'src/prisma/client';
import { Type } from 'class-transformer';
export class CreateTaskDto {
  @ApiProperty({
    example: 1,
    description: 'user id',
  })
  @IsInt()
  @Type(() => Number)
  readonly userId: number;

  @ApiProperty({
    example: 'task1',
    description: 'task name',
  })
  @IsString()
  readonly name: string;
  @ApiProperty({
    example: 'true',
    description: 'async time strategy',
  })
  @IsBoolean()
  readonly syncStrategy: boolean;
  @ApiProperty({
    example: 'sync data',
    description: 'sync data',
  })
  @IsString()
  readonly syncData: string;
  @ApiProperty({
    example: 'CREATED',
    description: 'status of task',
  })
  @IsEnum(TaskStatus)
  readonly status: TaskStatus;

  @ApiProperty({
    example: 'RTx 3060',
    description: 'search keyword',
  })
  @IsString()
  readonly keyword: string;
  @ApiProperty({
    example: '[1]',
    description: 'platformids',
  })
  @IsArray()
  readonly platforms: number[];
}
